if __name__ == '__main__':

    '''
    list
    tuple
    dict set
    '''

    list1 = [1,2,3]

    list2 = [[1,2,3],
             [4,5,6],
             [7,8,9]]

    print(list2[1][1])

    list1.reverse()

    print(list1)



    tuple1 = (1,2,3)


    tupleOnly = (1,) #只有一个元素时要,

    dict1 = {'name':'小明','age':19}
    set1 = {1,2,3,1,1}#不可重复,没有索引的

    print(set1,type(set1))

    for e in set1:
        print(e)


    """
    通用函数
    in not in 判断某元素是否在集合中
    """

    print('name' in dict1)

    student1= {'name':'小明','age':19}

    print(student1['name'])
    print(student1.get("age"))
    print(student1.values(),student1.keys(),student1.items(),sep="\n")

    for k,v in student1.items():
        print(k,v,sep=" : ")

"""
拆包和组包
() --- n个变量 拆开
n个变量 ---() 组包 
"""

a,b = [1,2]
c = a,b
print(a,b,sep=" : ")
print(c)




